package com.qf.controller;

import com.qf.pojo.reqVo.OrderReq;
import com.qf.pojo.respVo.BaseResp;
import com.qf.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    OrderService orderService;

    /**
     * 新增订单
     */
    @RequestMapping("/addOrder")
    public BaseResp addOrder(@RequestBody OrderReq orderReq, HttpServletRequest request){
        return orderService.addOrder(orderReq,request);
    }

    @RequestMapping("/findOrderByUserId")
    public BaseResp findOrderByUserId(HttpServletRequest request,@RequestBody  OrderReq orderReq){
        return orderService.findOrderByUserId(request,orderReq);
    }
}
